package com.zb.controller;

import com.zb.service.TbOrderService;
import com.zb.util.TokenDecode;
import com.zb.vo.BuyGoodsVO;
import com.zb.vo.OrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName TbOrderController
 * @Description 控制器
 * @Author xm
 * @Date 2024/11/06 15:05
 **/
@RestController
@RequestMapping("/tb-order-model")
public class TbOrderController {

    @Autowired
    public TbOrderService tbOrderModelService;

    @PostMapping("/create-order")
    public Boolean createOrder(@RequestBody OrderVO orderVO) {
        String username = TokenDecode.getUserInfo().get("username");
        orderVO.setUsername(username);
        return tbOrderModelService.createOrder(orderVO);
    }

}
